import VueRouter from 'vue-router'
import Vue from 'vue'
// import home from '@/views/home'
// import agents from '@/views/agents'
// import category from '@/views/category'
// import page from '@/views/page'
// import detail from '@/views/detail'


// import test from '@/components/Navbar'

// import test from '@/views/test'

import Layout from '@/layout'

Vue.use(VueRouter)


const routes = [
    {
        path: '/',
        component: Layout,
        redirect: 'home',
        children: [
            {
                path: 'home',
                name: 'home',
                component:() => import('@/views/home')
            }
        ]
    },
    {
        path: '/agents',
        component: Layout,
        children: [
            {
                path: '',
                name: 'agents',
                component:() => import('@/views/agents')
            }
        ]
    },
    {
        path: '/property',
        component: Layout,
        children: [
            {
                path: '',
                name: 'property',
                component:() => import('@/views/property')
            }
        ]
    },
    {
        path: '/category',
        component: Layout,
        children: [
            {
                path: '',
                name: 'category',
                component:() => import('@/views/category')
            }, 
            {
                path: '/detail/:id',
                name: 'detail',
                component:() => import('@/views/detail')
            }
        ]
    },
    {
        path: '/page',
        component: Layout,
        children: [
            {
                path: '',
                name: 'page',
                component:() => import('@/views/page')
            }
        ]
    }, {
        path: '/test',
        component: () => import('@/views/test')
    }
]

const router = new VueRouter({
    routes
})

export default router